home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / fido / GMS_1_1_85.lha / GMS / Rexx / GMS_general.rexx < prev    next >
OS/2 REXX Batch file  |  1995-04-19  |  1KB  |  67 lines

  1. /*
  2.  * $VER: GMS_General.rexx 1.1 (12.4.95)
  3.  *
  4.  */
  5.  
  6. options results
  7. signal on error
  8. signal on syntax
  9.  
  10. parse arg gms_command gms_line gms_arguments
  11.  
  12. if( ~show( 'l', "gms_mailer_rexx.library" ) ) then
  13. do
  14.    if( ~addlib( "gms_mailer_rexx.library", 0, -30, 0 ) )then
  15.    do
  16.       say "Could not open gms_mailer_rexx.library"
  17.       exit 10
  18.    end
  19. end
  20.  
  21. if gms_command == '' then signal Usage
  22. if gms_line    == '' then gms_line = 0
  23.  
  24. i = gms_arguments; gms_arguments = "'gms_mailer'"
  25.  
  26. do while length( i ) ~= 0
  27.  
  28.    parse var i j ',' i
  29.  
  30.    j = strip( j, 'B' )
  31.  
  32.    if gms_arguments ~= '' then gms_arguments = gms_arguments' , "'j'"'
  33.    else                        gms_arguments =                 '"'j'"'
  34.  
  35. end
  36.  
  37. call GMS_Mailer_System_Alloc('gms_mailer', gms_line, 'nonew')
  38.  
  39. say "ret =" gms_command || "(" gms_arguments ")"
  40. interpret "ret =" gms_command || "(" gms_arguments ")"
  41.  
  42. say 'Result =' ret
  43.  
  44. call GMS_Mailer_System_Free('gms_mailer')
  45.  
  46. call GMS_Mailer_FreeScriptData()
  47. exit 0
  48.  
  49. Usage:
  50.  
  51. say 'Usage: rx GMS_General[.rexx] <cmd name> <line num> <cmd args>'
  52.  
  53. call GMS_Mailer_FreeScriptData()
  54. exit 0
  55.  
  56. error:
  57. syntax:
  58.  
  59. error_text = GMS_Mailer_LastError()
  60.  
  61. if error_text = '' then error_text = rc ErrorText( rc )
  62.  
  63. say '| ***BREAK: error at' sigl error_text
  64.  
  65. call GMS_Mailer_FreeScriptData()
  66. exit rc
  67.